﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Shop.Intermediate.Data;

namespace Shop.Data.LinqToEntityProvider
{
    public partial class Department : IDepartment
    {

    }

    public partial class BasicData : IBasicData
    {
        public IBasicType BasicTypeEntity
        {
            get
            {
                if (!this.BasicTypeReference.IsLoaded)
                    this.BasicTypeReference.Load();
                return this.BasicType as IBasicType;
            }
            set
            {
                this.BasicType = (BasicType)value;
            }
        }
    }

    public partial class BasicType : IBasicType
    {
        public IEnumerable<IBasicData> BasicDataEntity
        {
            get
            {
                this.BasicData.Load();
                IEnumerable<BasicData> query = this.BasicData as IEnumerable<BasicData>;
                return query.Cast<IBasicData>();
            }
            set
            {
                if (value != null)
                {
                    IEnumerable<BasicData> query = value as IEnumerable<BasicData>;
                    this.BasicData = query as System.Data.Objects.DataClasses.EntityCollection<BasicData>;
                }
                else
                {
                    this.BasicData = null;
                }
            }
        }
    }
}